home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
shared.dir
/
03028_Script_Back List
< prev
next >
Wrap
Text File
|
1996-06-21
|
3KB
|
92 lines
-- --------------------------------------------------------
-- Handler addSectionToBackList adds the given sectionName to
-- a list of visited sections to be used by the back button.
on addSectionToBackList sectionName
global backList, backFlag
-- note: the first time this is called, it will be sent a void
-- parameter. only add nonVoid values.
-- note: only add the sectionName to the list if the back
-- button was not clicked (to prevent going back and forth
-- between two sections by clicking numerous times on the
-- back button)
if not(voidP(sectionName)) and not(backFlag) then
add(backList, sectionName)
end if
end
-- --------------------------------------------------------
-- Handler goBack goes to the last section visited.
on goBack
global backList
set numSections = count(backList)
if numSections then -- ie. if the list contains anything
set lastSection = getAt(backList,numSections)
deleteAt(backList,numSections) -- remove from list
setBackFlag(TRUE)
goSection(lastSection)
end if
end
-- --------------------------------------------------------
-- Handler checkBackButtonClick checks if the user clicked
-- the back button and, if so, calls goBack.
on checkBackButtonClick mousePoint
global backButtonRect
if inside(mousePoint,backButtonRect) then
doClickBackButton
end if
end
-- --------------------------------------------------------
-- Handler clickMenuBar checks if the user clicked
on clickMenuBar mousePoint
checkBackButtonClick mousePoint
end
-- --------------------------------------------------------
-- Handler setBackFlag sets the global variable backFlag to
-- the given value. This is used in maintaining the global
-- variable backList.
on setBackFlag val
global backFlag
set backFlag = val
end
-- --------------------------------------------------------
-- Handler doClickBackButton
on doClickBackButton
hiliteBackButtonClick
goBack
removefromStage (labelSprite)
end
-- --------------------------------------------------------
-- Handler hiliteBackButton
on hiliteBackButtonClick
global labelSprite, backAH, backAV
puppetSprite labelSprite, TRUE
set the castNum of sprite labelSprite = the number of cast "BackButton ACTIVATED"
set the locH of sprite labelSprite = backAH
set the locV of sprite labelSprite = backAV
set the height of sprite labelSprite = the height of cast "BackButton ACTIVATED"
set the width of sprite labelSprite = the width of cast "BackButton ACTIVATED"
updateStage
repeat while the mouseDown
nothing
end repeat
end